{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
{load href="__PLUGINS__layui/layui.js"}
{load href="__PLUGINS__layui/css/layui.css"}
<style type="text/css">
#des,#des input{ width: 40px;text-align:center;}
#id{ width: 78px; }
.bs-checkbox{ width: 36px; height: 40px }
.fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
#title span{ float: right; }
.asdlkjasd{ background: #1ab394; color: #fff}
</style>
 <body class="gray-bg">
 <div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
        {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar">
                        <a class="btn btn-default btn-outline {eq name='state' value='0'}asdlkjasd{/eq}" href="{:url('Member/recyclereview',['state'=>'0'])}">待审核</a>
                        <a class="btn btn-default btn-outline {eq name='state' value='1'}asdlkjasd{/eq}" href="{:url('Member/recyclereview',['state'=>'1'])}">已通过</a>
                        <a class="btn btn-default btn-outline {eq name='state' value='-1'}asdlkjasd{/eq}" href="{:url('Member/recyclereview',['state'=>'-1'])}">已拒绝</a>
                    </div>
                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form  method="get" action="">
                            <div class="pull-left search">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="type">
                                        <option value="id" {php}if(input('?param.type')){if(input('param.type')=='id'){echo "selected";} }{/php}>用户ID</option>
                                        <option value="name" {php}if(input('?param.type')){if(input('param.type')=='name'){echo "selected";} }{/php}>姓名</option>
                                        <option value="phone" {php}if(input('?param.type')){if(input('param.type')=='phone'){echo "selected";} }{/php}>手机</option>
                                    </select>
                                </div>
                                {php}
if(input('?param.name')){
{/php} 
<div class="pull-right search">
    <a class="btn btn-w-m btn-link" href="{:url('member/revideo')}">返回用户管理</a>
</div>{php}
}
{/php}
                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" type="text"
{php}
if(input('?param.name')){
            if(input('param.name')){
               echo "value='".input('name')."'";
            } 

        }
{/php}
                                     name="name" placeholder="搜索会员">
                                </div>
                                

                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                                <tr>
                                    <th class="bs-checkbox"><input type="checkbox" id="delidAll"></th>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">头像</th>                            
                                    <th>昵称</th>                                   
                                    <th>总提现</th>                                   
                                    <th data-align="center">性别</th>                                    
                                    <th>手机</th>
                                    <th>总充值</th>
                                    <th>申请时间</th>
                                    {if condition="$state neq '0'"}
                                    <th>处理时间</th>
                                    {/if}
                                    <th>状态</th>
                                    {if condition="$state eq '-1'"}
                                    <th>拒绝原因</th>
                                    {/if}               
                                    {if condition="$state eq '0'"}                
                                    <th>管理</th>
                                    {/if}              
                                </tr>
                            </thead> 
                            <tbody id="form">
                                {php}$hide=array('0'=>'<font color="#f00">禁止</font>','1'=>'<font color="#1ab394">正常</font>','2'=>'审核','3'=>'<font color="#f00">拒绝</font>');{/php}
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td id="delid" ><input name="delAll[]" type="checkbox" value="{$v.id}"></td>
                                    <td>{$v.id}</td>
                                    <td>
                                        <a href="__ROOT__{$v.head_portrait}" title="{$v.name}" target="_blank">
                                            <img style="width:40px;height:40px;" src="__ROOT__{$v.head_portrait}"/>
                                        </a>
                                    </td>
                                    <td><a onclick="member('{$v.id}')" style="color:#40BCF7">{$v.name}</a></td>
                                    <td>{$v.withdraw_sum}</td>  
                                    <td>{$v.sex}</td>                                 
                                    <td>{$v.phone}</td>
                                    <td>{$v.topup_sum}</td>
                                    <td>{$v.create_time | date="Y-m-d H:i:s",###}</td>
                                    {if condition="$state neq '0'"}
                                    <td>{$v.update_time | date="Y-m-d H:i:s",###}</td>
                                    {/if}
                                    <td>{if condition="$v.state eq '0'"}审 核{elseif condition="$v.state eq '1'" /}通 过{elseif condition="$v.state eq '-1'" /}拒 绝{/if}</td>
                                    {if condition="$state eq '-1'"}
                                    <td>{$v.remark}</td>
                                    {/if}
                                    {if condition="$state eq '0'"}
                                    <td>
                                        <div class="btn-group">
                                            <div onclick="x_admin_show('编辑','{:url('recycleedit',['id'=>$v['rid'],'url'=>-1])}')" class="btn btn-primary btn-xs dropdown-toggle">审核
                                            </div>
                                        </div>
                                    </td>
                                    {/if}
                                </tr>
                                {/volist}
                            </tbody>
                        </table>
                        </form>
                    </div>
                </div>  
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-6">
                    <div  class="btn btn-outline btn-default" onclick="alla(1)">
                        批量通过
                    </div>
                </div>
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
$(document).ready(function(){
        $('#delidAll').click(function(){
            $('input[type=checkbox]').each(function(){
                var self=$(this);
                if(!self.prop('checked')){
                    self.prop('checked',true);
                }else{
                    self.prop('checked',false);
                }
            });
        })
});
function x_admin_show(title,url,w,h)
{
    if (title == null || title == '') {
        title=false;
    };
    if (url == null || url == '') {
        url="404.html";
    };
    if (w == null || w == '') {
        w=($(window).width()*0.9);
    };
    if (h == null || h == '') {
        h=($(window).height() - 50);
    };
    layer.open({
        type: 2,
        area: [w+'px', h +'px'],
        fix: false, //不固定
        maxmin: true,
        shadeClose: true,
        shade:0.4,
        title: title,
        content: url,
        end: function (){
            window.location.reload();
        }

    });
}
function member(id)
{
    layui.use('layer', function(){
        var layer = layui.layer;
        layer.open({
            title :'预览',
            area: ['100%', '100%'],
            type: 2,
            content: '{:url("index")}?search=id&name='+id
        });
    });
}
function alla(types){
    var all=$(".form-horizontal").serialize();
    var alls=$(".form-horizontal").serializeArray();
    console.log(JSON.stringify(alls))

    ajaxFun("post",'{:url('shenheAllRecycle')}?type='+types,all,'json',function(ret){
        if(ret){
            setTimeout(()=>{
                window.location.href = window.location
            },1000)
            swal_msg(ret.ret ? ret.ret : ret.err)
        }
    })

}
</script>
 